<template>
 <div class="app-container" style="margin-top: -20px;">

  <el-row :gutter="10" class="mb8">
    <right-toolbar :search="search" @queryTable="getList" ></right-toolbar>
  </el-row>

    <el-table v-loading="loading" :data="userBannedList">
      <el-table-column label="用户头像" align="center" prop="headUrl" >
        <template  slot-scope="scope">
          <ImagePreview :src="scope.row.headUrl" width="50px" height="50px">

          </ImagePreview>
        </template>

      </el-table-column>

      <el-table-column label="爱洞ID" align="center" prop="platformId" />
      <el-table-column label="用户昵称" align="center" prop="nickName"  />
      <el-table-column label="手机号" align="center" prop="phoneNum"  />

      <el-table-column label="封号类型" align="center" prop="limitType" >
        <template slot-scope="scope">
          <dict-tag :options="dict.type.limit_type" :value="scope.row.limitType" />
        </template>
      </el-table-column>

      <el-table-column label="开始时间" align="center" prop="createTime" >
      </el-table-column>
      <el-table-column label="结束时间" align="center" prop="endTime" >
      </el-table-column>
      <el-table-column label="操作原因" align="center" prop="reason" />
      <el-table-column label="备注" align="center" prop="remark" />
    </el-table>

    <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />


  </div>
</template>

<script>
  import {
    listUserBanned
  } from "@/api/service/userBanned/userBanned";

  export default {
    name: "UserBannedQuery",
    dicts: ['limit_type'],
    props: {
      phone: {
        type: String,
        default: '-1'
      }
    },
    data() {
      return {
               search:false,
        // 按钮loading
        buttonLoading: false,
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        // 封号信息表格数据
        userBannedList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          limitType: undefined,
          phoneNum: this.phone,
          platformId:undefined
        },
        // 表单参数
        form: {},
        // 表单校验
      };
    },
    created() {
      this.getList();
    },
    methods: {
      /** 查询封号信息列表 */
      getList() {
        this.loading = true;
        listUserBanned(this.queryParams).then(response => {
          this.userBannedList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },





    }
  };
</script>
